cmake_minimum_required(VERSION 3.15)
project(tests)
enable_testing()
include("../example/function.cmake")
set(Data_Dir ${CMAKE_CURRENT_LIST_DIR}/../include/SEvoBench/problem/cec/)
add_executable(test_tool test_tool.cpp)
add_executable(test_parallel_task test_parallel_task.cpp)
add_executable(test_algorithm test_algorithm.cpp)
add_executable(test_positions test_positions.cpp)
add_executable(test_pso_module test_pso_module.cpp)
add_executable(test_de_module test_de_module.cpp)
add_executable(test_experiment test_experiment.cpp)
add_executable(test_cec2017 test_cec2017.cpp cec17_test_fast_pow.cpp)
add_executable(test_cec2014 cec14_test_func.cc
        test_cec2014.cpp)
add_executable(test_cec2020 cec20_test_func.cpp
        test_cec2020.cpp)
add_executable(test_cec2022 cec22_test_func.cpp
        test_cec2022.cpp)
add_executable(test_cec2010 test_cec2010.cpp)
add_executable(test_simd test_simd.cpp)
common(test_tool)
common(test_parallel_task)
common(test_algorithm)
common(test_positions)
common(test_pso_module)
common(test_de_module)
common(test_experiment)
common(test_cec2014)
common(test_cec2017)
common(test_cec2020)
common(test_cec2022)
common(test_cec2010)
common(test_simd)
target_compile_definitions(test_cec2014 PRIVATE DATA_DIR="${Data_Dir}")
target_compile_definitions(test_cec2017 PRIVATE DATA_DIR="${Data_Dir}")
target_compile_definitions(test_cec2020 PRIVATE DATA_DIR="${Data_Dir}")
target_compile_definitions(test_cec2022 PRIVATE DATA_DIR="${Data_Dir}")
add_test(NAME test_tool COMMAND test_tool)
add_test(NAME test_algorithm COMMAND test_algorithm)
add_test(NAME test_parallel_task COMMAND test_parallel_task)
add_test(NAME test_positions COMMAND test_positions)
add_test(NAME test_pso_module COMMAND test_pso_module)
add_test(NAME test_de_module COMMAND test_de_module)
add_test(NAME test_experiment COMMAND test_experiment)
add_test(NAME test_cec2014 COMMAND test_cec2014)
add_test(NAME test_cec2017 COMMAND test_cec2017)
add_test(NAME test_cec2020 COMMAND test_cec2020)
add_test(NAME test_cec2022 COMMAND test_cec2022)
add_test(NAME test_cec2010 COMMAND test_cec2010)
add_test(NAME test_simd COMMAND test_simd)